﻿
<div class="quarterly-report-container">
    <div class="row">
        <div class="col-xs-4">
            <h3><strong> QUARTERLY REPORT</strong></h3>
        </div>
        <div class="col-xs-4">
            <h3>
                Report Date: <a style="display:inline-block; margin:0;" href="#" editable-date="currentQuarterlyReportDate" buttons="no" blur="submit" e-name="currentQuarterlyReportDate">{{currentQuarterlyReportDate | date: 'dd/MM/yyyy'}}</a>
            </h3>
        </div>
        <div class="col-xs-3"><h3>by: {{fullName}}</h3></div>
        <div class="col-xs-1"><button class="btn btn-info navbar-btn hidden-print" ng-click="doPrint()"><i class="glyphicon glyphicon-print"></i> Print</button></div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th class="col-xs-2">STATISTIC by Quarters</th>
                        <th class ="text-right">Quarter</th>
                        <th class="text-right">Quarter</th>
                        <th class="text-right">Quarter</th>
                        <th class="text-right">Quarter</th>
                        <th class="text-right">Year</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td></td>
                        <td class="col-xs-2 text-right"><strong>1</strong></td>
                        <td class="col-xs-2 text-right"><strong>2</strong></td>
                        <td class="col-xs-2 text-right"><strong>3</strong></td>
                        <td class="col-xs-2 text-right"><strong>4</strong></td>
                        <td class="col-xs-2 text-right"><strong><a href="#" editable-text="yearInput" onaftersave="getQuarterlyReport()">{{ yearInput || 0 }}</a></strong></td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total Quotes</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfQuote }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total PO</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfPO }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total Failed Quotes</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">{{ report.noOfQuote - report.noOfPO }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total WO</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfWO }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total Failed PO</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">{{ report.noOfPO - report.noOfWO }}</td>
                    </tr>
                    <tr  ng-hide="!quarterlyReport">
                        <td>Total Certificates</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">{{ report.noOfCert }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total Equipt Calibrated</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfEquipmentCalibrated }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Equipt Calibrated by Vendor</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfEquiptCalibratedByVendors }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>New Customer</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfNewCustomer }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Standards dues</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.noOfStandardsDues }}</td>
                    </tr>
                    <tr>
                        <td class="landing-row" colspan="{{1 + quarterlyReport.length}}"></td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total Invoice Value</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">{{ report.totalInvoiceValue || 0 | number }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td>Total PO value</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">{{ report.totalPOValue  || 0 | number }}</td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td ng-hide="!quarterlyReport">Operation expenses</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport | limitTo: quarterlyReport.length - 1" class="col-xs-1">
                            {{ report.operationExpenses || 0 | number }}
                        </td>
                        <td class="text-right">
                            {{sumOE(quarterlyReport)|| 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td ng-hide="!quarterlyReport">Total AE</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport | limitTo: quarterlyReport.length - 1" class="col-xs-1">
                            {{ report.totalAEExpenses  || 0 | number }}
                        </td>
                        <td class="text-right">
                            {{sumAE(quarterlyReport)|| 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Taxi-Shipping
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other1 || 0 | number }}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            PO Diem
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other2 || 0 | number }}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Marketing Cost
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other3 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Pay Vendor
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other4 || 0 | number }}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Office Supplies
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other5 || 0 | number }}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Office Rental
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other6 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Office Utilities
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other7 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Office maintenance
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other8 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Office Phone & Mobile
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other9 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Pay Interest
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other10 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Others
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other11 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Taxes
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other12 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td align="right">
                            Standards
                        </td>
                        <td class="text-right" ng-repeat="report in quarterlyReport">
                            {{ report.other13 || 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td ng-hide="!quarterlyReport">Profit gain before Tax</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">
                            {{report.totalPOValue - report.totalAEExpenses - report.operationExpenses | number }}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td ng-hide="!quarterlyReport">Profit tax</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport | limitTo: quarterlyReport.length - 1" class="col-xs-1">
                            {{ report.tax  || 0 | number }}
                        </td>
                        <td class="text-right">
                            {{sumTax(quarterlyReport)|| 0 | number}}
                        </td>
                    </tr>
                    <tr ng-hide="!quarterlyReport">
                        <td ng-hide="!quarterlyReport">Profit gain after Tax</td>
                        <td class="text-right" ng-repeat="report in quarterlyReport" class="col-xs-1">
                            {{report.totalPOValue - report.totalAEExpenses - report.operationExpenses - report.tax | number }}
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>